package cn.dengta.webapp.ai.model;

import java.io.InputStream;
import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class AIGCT2AResult implements Serializable {

	/**
	 * 可能为空，oss路径，用于下载音频， 返回给前端时优先取 url
	 */
	String url;

	/**
	 * url为空时必有值
	 */
	InputStream inputStream;

	String md5;

	public boolean hasUrl() {
		return url != null;
	}

	public static AIGCT2AResult of(String url, String md5) {
		AIGCT2AResult result = new AIGCT2AResult();
		result.setUrl(url);
		result.setMd5(md5);
		return result;
	}

	public static AIGCT2AResult of(InputStream inputStream, String md5) {
		AIGCT2AResult result = new AIGCT2AResult();
		result.setInputStream(inputStream);
		result.setMd5(md5);
		return result;
	}
}
